﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:DotNTech" 
    xmlns:Converters="clr-namespace:DotNTech.Converters" 
    xmlns:Binding="clr-namespace:DotNTech.Binding"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    >
    
    <Converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />

    <Style x:Name="AppBarText" TargetType="ContentControl">
        <Setter Property="HorizontalAlignment" Value="Center" />
        <Setter Property="FontSize" Value="12" />
        <Setter Property="Margin" Value="0,7,0,0" />
    </Style>
    <Style TargetType="local:LinkLabel">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:LinkLabel">
                    <toolkit:WrapPanel x:Name="LayoutRoot"
                                        Orientation="Horizontal">
                    </toolkit:WrapPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="local:RoundButton">
        <Setter Property="BorderBrush" Value="{StaticResource PhoneContrastBackgroundBrush}"/>
        <Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
        <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilySemiBold}"/>
        <Setter Property="FontSize" Value="12" />

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:RoundButton">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver"/>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="ButtonBackground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneContrastBackgroundBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Stroke" Storyboard.TargetName="ButtonBackground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneContrastBackgroundBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="ButtonForeground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneBackgroundBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Stroke" Storyboard.TargetName="ButtonBackground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="ButtonBackground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TransparentBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="ButtonForeground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentBody">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>

                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>

                        <Rectangle Fill="Transparent" />
                        <Border 
							Height="{TemplateBinding Height}"
							Width="{TemplateBinding Width}"
							Padding="{TemplateBinding Padding}" 
							BorderThickness="0" 
							BorderBrush="Transparent">
                            <StackPanel 
								Orientation="{TemplateBinding Orientation}"
								VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
								HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}">

                                <Grid 
									Width="{TemplateBinding ButtonWidth}" 
									Height="{TemplateBinding ButtonHeight}" 
									Margin="0,-10, 0, 0">
                                    <Ellipse
										x:Name="ButtonBackground"
										Stroke="{TemplateBinding BorderBrush}" 
										StrokeThickness="3" 
										Fill="{TemplateBinding Background}" 
										Margin="{StaticResource PhoneTouchTargetOverhang}" />
                                    <Ellipse
										x:Name="ButtonForeground" 
										Fill="{TemplateBinding Foreground}" 
										Margin="{StaticResource PhoneTouchTargetOverhang}">
                                        <Ellipse.OpacityMask>
                                            <ImageBrush x:Name="OpacityImageBrush" Stretch="{TemplateBinding Stretch}" />
                                        </Ellipse.OpacityMask>
                                    </Ellipse>
                                </Grid>

                                <ContentControl 
									x:Name="ContentBody" 
									Content="{TemplateBinding Content}" 
									FontSize="{TemplateBinding FontSize}"
									Style="{StaticResource AppBarText}"/>
                            </StackPanel>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:ToastPrompt">
        <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilyNormal}"/>
        <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeSmall}"/>
        <Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
        <Setter Property="Background" Value="{StaticResource PhoneAccentBrush}"/>
        <Setter Property="VerticalAlignment" Value="Bottom" />
        <Setter Property="Overlay" Value="Transparent" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:ToastPrompt">
					<Grid
                        VerticalAlignment="{TemplateBinding VerticalAlignment}"
                        Background="{TemplateBinding Background}">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="60"/>
                        </Grid.ColumnDefinitions>
                        <!--<StackPanel Grid.Row="0" Grid.Column="0"
							VerticalAlignment="Bottom" 
							Margin="24, 32, 16, 5" 
							Orientation="{TemplateBinding TextOrientation}">-->
                            <Grid Visibility="Collapsed" Name="container">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="100"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"></RowDefinition>
                                </Grid.RowDefinitions>
                                <Image Grid.Column="0" Grid.Row="0" Width="84"
                                        Margin="0,0,16,0"
								        Visibility="Visible"
								        Name="ToastImage"
                                        VerticalAlignment="Center"></Image>
                                <toolkit:WrapPanel Grid.Column="1" Margin="0" VerticalAlignment="Top" Orientation="Horizontal" Name="wrapper">
                                    <TextBlock 
                                            VerticalAlignment="Top"
                                            Name="ToastName"
								            Text="{TemplateBinding Title}"
								            FontWeight="Bold"
								            Margin="0"
                                            Padding="0" 
                                            TextWrapping="Wrap"
                                            FontFamily="Arial" FontSize="20"
                                            />
                                </toolkit:WrapPanel>
                            </Grid>
                            <!--</StackPanel>-->
                            <TextBlock 
                                Text="{TemplateBinding Message}" 
								Margin="0"
                                Padding="1" TextWrapping="Wrap" FontFamily="Arial" FontSize="20" FontWeight="Bold" VerticalAlignment="Top"/>
                            <Image Margin="0" Name="ToastBigImage" Grid.ColumnSpan="2"></Image>
						<!--</StackPanel>-->
                        <local:RoundButton Grid.Row="0" Grid.Column="1" VerticalAlignment="Center" x:Name="btnShowAd" HorizontalAlignment="Right"></local:RoundButton>
                        <!--<local:RoundButton Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" x:Name="btnShowAd2" HorizontalAlignment="Right" Visibility="Collapsed"></local:RoundButton>-->
					</Grid>                     
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    
</ResourceDictionary>